package com.den4.jynform;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.quartz.Trigger;

import com.den4.jynform.alerts.Logger;

public class JobBean implements Serializable {
    private int id;
    private String type;
    private Map<String, Object> params = new HashMap<String, Object>();
    private List<Trigger> triggers = new ArrayList<Trigger>();
    private Logger onFailLogger;
    private Logger onSuccessLogger;
    
    public JobBean(int id, String type) {
        this.id = id;
        this.type = type;
    }
    
    public JobBean() {
        
    }
    
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    
    public Map<String, Object> getParams() {
        return params;
    }
    
    public void setParams(Map<String, Object> params) {
        this.params = params;
    }
    
    public List<Trigger> getTriggers() {
        return triggers;
    }
    
    public void setTriggers(List<Trigger> triggers) {
        this.triggers = triggers;
    }
    
    public Logger getOnFailLogger() {
        return onFailLogger;
    }
    
    public void setOnFailLogger(Logger onFailLogger) {
        this.onFailLogger = onFailLogger;
    }
    
    public Logger getOnSuccessLogger() {
        return onSuccessLogger;
    }
    
    public void setOnSuccessLogger(Logger onSuccessLogger) {
        this.onSuccessLogger = onSuccessLogger;
    }
    
    public Object clone() {
        JobBean cloned = new JobBean(this.id, this.type);
        cloned.setParams(this.params);
        cloned.setTriggers(this.triggers);
        cloned.setOnFailLogger(this.onFailLogger);
        cloned.setOnSuccessLogger(this.onSuccessLogger);
        return cloned;
    }
}
